<?xml version="1.0" encoding="utf-8" ?>

<xsl:stylesheet version="1.0"
	xmlns:date="http://exslt.org/dates-and-times"
  xmlns:ebe="http://cks/ebemethods"
	xmlns:string="http://exslt.org/strings"
	xmlns:ms="urn:schemas-microsoft-com:xslt"
  xmlns:dt="urn:schemas-microsoft-com:datatypes"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  exclude-result-prefixes="date ebe string">
  <xsl:param name="IsBlogOwner" />
  <xsl:param name="RelativeUrl" />
  <xsl:param name="Language" />
  <xsl:param name="ShortMonthDayPattern" />
  <xsl:param name="IsTechnoratiEnabled" />

  <xsl:output omit-xml-declaration="yes" />
	<xsl:template match="/">
		<!-- <xmp><xsl:copy-of select="."/></xmp> -->
		<xsl:apply-templates select="rows/row"/>
	</xsl:template>
	<xsl:template match="row">
		<br/>
		
		<div>
			<h2>
				<xsl:value-of select="Title"/>
			  <xsl:if test="$IsBlogOwner = 'True'">&#160;
			  <span class="small"><a href="/{substring-after(FileDirRef,'#')}/EditPost.aspx?ID={ID}">
					  [<xsl:value-of select="ebe:res('EditPost')"/>]
				  </a></span>
		    </xsl:if>
        &#160;<xsl:value-of select="ebe:ExportPDF('themes/Intensive/images/exportPDF.gif', ID)" disable-output-escaping="yes" />
			</h2>
			<div class="blogcontent">
	<xsl:variable name="publishedDate" select="date:parseDate(PublishedDate, 'yyyy-MM-dd HH:mm:ss')" />

		<div class="date">
			<span class="month">
        <xsl:value-of select="ms:format-date($publishedDate, $ShortMonthDayPattern, $Language)"/>
      </span>
		<span class="day">
      <xsl:value-of select="ms:format-date($publishedDate, 'yyyy')"/>
    </span>
		</div>			<div class="entry">
					<xsl:value-of select="Body" disable-output-escaping="yes"/>
				</div>
				<div class="clear">&#160;</div>
			</div>
			<div class="bottompost-text">
        <xsl:value-of select="ebe:res('PostedBy')"/>&#160;<xsl:value-of select="substring-after(Author,'#')"/>

        | <xsl:value-of select="NumComments"/>&#160;
        <xsl:choose>
          <xsl:when test="NumComments = 1">
            <xsl:value-of select="ebe:res('Comment')"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="ebe:res('Comments')"/>
          </xsl:otherwise>
        </xsl:choose>
        | <a href="{$RelativeUrl}/_layouts/cks/ebe/Trackback.aspx?ID={ID}" rel="trackback">
          <xsl:value-of select="ebe:res('TrackbackUrl')"/>
        </a>
        &#160;|&#160;<a href="{ebe:createPostUrl(PublishedDate, BlogTitleForUrl)}">
          <xsl:value-of select="NumLinkbacks"/>&#160;
          <xsl:choose>
            <xsl:when test="NumTrackbacks = 1">
              <xsl:value-of select="ebe:res('Trackback')"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="ebe:res('Trackbacks')"/>
            </xsl:otherwise>
          </xsl:choose>
        </a>
        | <xsl:value-of select="ebe:res('BookmarkPost')"/>:  <span class="categories-post">
          <a href="http://del.icio.us/post?url={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}&amp;title={Title}" title="Add to del.icio.us"><img src="{$RelativeUrl}/themes/Clean/images/delicious.png" border="0"/></a>
          &#160;
          <a href="http://digg.com/submit?phase=2&amp;url={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}" title="Digg it"><img src="{$RelativeUrl}/themes/clean/images/digg.png" border="0"/></a>
          &#160;
          <a href="http://technorati.com/cosmos/search.html?url={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}" title="Add to Technorati"><img src="{$RelativeUrl}/themes/clean/images/technorati.png" border="0"/></a>
          &#160;
          <a href="http://www.facebook.com/share.php?u={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}" title="Add to Facebook"><img src="{$RelativeUrl}/themes/clean/images/facebook.gif" border="0"/></a>
          &#160;
          <a href="http://reddit.com/submit?url={ebe:createAbsolutePostUrl(PublishedDate, BlogTitleForUrl)}&amp;title={Title}" title="Add to Reddit"><img src="{$RelativeUrl}/themes/clean/images/reddit.png" border="0"/></a>
        </span>

        <br/>

        <xsl:value-of select="ebe:res('Tags')"/>:
        <xsl:for-each select="string:split(CategoriesAsText, ';')">
						<a href="{ebe:createTagUrl(.)}">
							<xsl:value-of select="."/>
						</a>
						<xsl:if test="position() != last()">, </xsl:if>
				</xsl:for-each>

        <xsl:if test="$IsTechnoratiEnabled = 'True'">
          <br/>
          <xsl:value-of select="ebe:res('TechnoratiTags')"/>:
          <xsl:for-each select="string:split(CategoriesAsText, ';')">
            <a href="http://technorati.com/tag/{.}" rel="tag">
              <xsl:value-of select="."/>
            </a>
            <xsl:if test="position() != last()">, </xsl:if>
          </xsl:for-each>
        </xsl:if>
        <br/>	
		<br/>	
		</div>		

	</div>
		<!-- close div content -->
	</xsl:template>
</xsl:stylesheet>
